package pokerbot.entities;

import java.util.ArrayList;
import java.util.List;

public class Hand {
    
    public final static int FIRST_CARD = 0;
    public final static int SECOND_CARD = 1;
    private final List<Card> cards = new ArrayList<>(2);

    public Hand(Card card1, Card card2) {
        cards.add(card1);
        cards.add(card2);
    }   

    public List<Card> getCards() {
        return cards;
    }

    @Override
    public String toString() {
        return cards.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof Hand) {
            Hand hand = (Hand) obj;
            return hand.getCards().get(FIRST_CARD).equals(this.cards.get(FIRST_CARD)) 
                    && hand.getCards().get(SECOND_CARD).equals(this.cards.get(SECOND_CARD));
        }
        return false;
    }

}
